
// Copyright (C) Recursion Company. All rights reserved.

#include "stdafx.h"
#include "vol_user_app_info.h"

//-----------------------------------------------------------------------------------------

CVWnd_ProgressBar::CVWnd_ProgressBar ()
{
    m_npInitialMin = 0;
    m_npInitialMax = 100;
    m_npInitialPos = 0;
}

BOOL CVWnd_ProgressBar::CreateControl (CVolNativeWndCreateParam* pCreateParam)
{
    if (_CREATE_WND_BY_PARAM (pCreateParam) != NULL)
    {
        ModifyWndStyleEx (this, 0, pCreateParam->m_dwExStyle);

        const INT nInitialMin = (INT)MIN (m_npInitialMin, m_npInitialMax);
        const INT nInitialMax = (INT)MAX (m_npInitialMin, m_npInitialMax);

        SetRange (nInitialMin, nInitialMax);
        SetPos (CLIP ((INT)m_npInitialPos, nInitialMin, nInitialMax));
        
        return TRUE;
    }

    return FALSE;
}
